package com.autonomous_printer.impl;

import com.autonomous_printer.mapper.FileMapper;
import com.autonomous_printer.mapper.ManagerMapper;
import com.autonomous_printer.mapper.OrderMapper;
import com.autonomous_printer.pojo.File;
import com.autonomous_printer.pojo.Manager;
import com.autonomous_printer.pojo.Order;
import com.autonomous_printer.service.ManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ManageServiceImpl implements ManageService {

    @Autowired
    ManagerMapper managerMapper;

    @Autowired
    FileMapper fileMapper;

    @Autowired
    OrderMapper orderMapper;

    @Override
    public boolean queryManager(Manager manager) {
        return managerMapper.selectManager(manager) > 0;
    }

    @Override
    public boolean addManager(Manager manager) {
        return managerMapper.addManager(manager) == 1;
    }

    @Override
    public List<File> queryFileAll() {
        return fileMapper.queryAllFiles();
    }

    @Override
    public List<Order> queryOrderAll() {
        return orderMapper.queryAllOrder();
    }
}
